from flask import Flask
import flask_cors
from page import Province
from page import cityLevel
from page import map

app = Flask(__name__)
flask_cors.CORS(app)


@app.route('/getDataOverview')
def getDataOverview():
    return Province.getDataOverview()


@app.route('/getMap')
def getMap():
    return Province.getMap()


@app.route('/getPermanentPopulation')
def getPermanentPopulation():
    return Province.getPermanentPopulation()


@app.route('/genderRatioOfPopulation')
def genderRatioOfPopulation():
    return Province.genderRatioOfPopulation()


@app.route('/getGDP')
def getGDP():
    return Province.getGDP()


@app.route('/averageHousePrice')
def averageHousePrice():
    return Province.averageHousePrice()


@app.route('/getCityAQI')
def getCityAQI():
    return Province.getCityAQI()


@app.route('/perCapitaConsumptionExpenditure')
def perCapitaConsumptionExpenditure():
    return Province.perCapitaConsumptionExpenditure()


@app.route('/residentPopulationInEachCity')
def residentPopulationInEachCity():
    return cityLevel.residentPopulationInEachCity()


@app.route('/getAQICity')
def getAQICity():
    return cityLevel.getAQICity()


@app.route('/getGrossDomesticProduct')
def getGrossDomesticProduct():
    return cityLevel.getGrossDomesticProduct()


@app.route('/getSalesRevenueOfCommercialHousing')
def getSalesRevenueOfCommercialHousing():
    return cityLevel.getSalesRevenueOfCommercialHousing()


@app.route('/getPerCapitaConsumption')
def getPerCapitaConsumption():
    return cityLevel.getPerCapitaConsumption()


@app.route('/permanentPopulation')
def permanentPopulation():
    return map.permanentPopulation()


@app.route('/grossDomesticProduct')
def grossDomesticProduct():
    return map.grossDomesticProduct()


@app.route('/disposableIncome')
def disposableIncome():
    return map.disposableIncome()


@app.route('/getMapData')
def getMapData():
    return map.getMapData()


if __name__ == '__main__':
    app.run()
